import request from '@/utils/request'

// 获取轮播图列表
export function getBannerList(params) {
  return request({
    url: '/admin/banners',
    method: 'get',
    params
  })
}

// 获取轮播图详情
export function getBannerDetail(bannerId) {
  return request({
    url: `/admin/banners/${bannerId}`,
    method: 'get'
  })
}

// 添加轮播图
export function addBanner(data) {
  return request({
    url: '/admin/banners',
    method: 'post',
    data
  })
}

// 更新轮播图
export function updateBanner(bannerId, data) {
  return request({
    url: `/admin/banners/${bannerId}`,
    method: 'put',
    data
  })
}

// 删除轮播图
export function deleteBanner(bannerId) {
  return request({
    url: `/admin/banners/delete/${bannerId}`,
    method: 'POST'
  })
}

// 更新轮播图排序
export function updateBannerOrder(data) {
  return request({
    url: '/admin/banners/order',
    method: 'put',
    data
  })
} 